Repository navigation
fix(macos): keep AppleDouble files and Python bytecode out of the app bundle - #173
Merged
Merged
Conversation
…oads (#172) codesign stores the signature of every non-Mach-O file under Contents/PlugIns and Contents/MacOS in extended attributes. `ditto -c -k` writes those into the zip as inline `._name` entries, which `unzip` (and any non-Apple extractor) turns into real files next to the originals. UTV then tried to load them, so startup logged "failed to load definition file" for each `._*.gto`. - Zip with `ditto -c -k --sequesterRsrc`, which stores the attributes under `__MACOSX/` instead. Finder, `ditto -x` and Homebrew still restore them, so the signature verifies; `unzip` leaves them outside UTV.app. - Skip `._*` files in NodeManager, profiles, brush tips and TwkUtil::findInPath (format, output, audio and CMS plugins, LUTs), so existing zips and SMB shares, which also create these files, stay quiet. Checked on a signed dev build: the current zip has 375 `._` entries inside UTV.app; the sequestered zip has none after `unzip`, and after `ditto -x` `codesign --verify --deep --strict` passes. Signed-off-by: Michael Oliver <mcoliver@gmail.com>
Python wrote __pycache__ next to the bundled modules on first launch. On macOS that adds files under UTV.app/Contents, which breaks the bundle's code signature (`codesign --verify` reports "a sealed resource is missing or invalid"). On Windows and Linux the install directory is usually read-only, so modules were recompiled on every launch. Set PYTHONPYCACHEPREFIX to ~/Library/Caches/UTV/pycache on macOS and to the generic cache location (~/.cache, %LOCALAPPDATA%) elsewhere, unless the user has already set it. Signed-off-by: Michael Oliver <mcoliver@gmail.com>
mcoliver
force-pushed
the
fix/macos-appledouble
branch
from
October 26, 2026 19:58
f25d974 to
61141c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #172.
AppleDouble
._*filescodesign stores signatures for non-Mach-O files under
Contents/PlugInsandContents/MacOSin extended attributes, andditto -c -kwrites those into the zip as inline._nameentries. Any extractor other than Finder or ditto,unzipfor example, turns them into real files, and UTV tried to load each._*.gto.dev-build.yml,release.ymlandbranch-build.ymlnow useditto -c -k --sequesterRsrc, which stores the attributes under__MACOSX/instead. Finder,ditto -xand Homebrew still restore them.TwkUtil::findInPathskip._*files.findInPathcovers the image, movie, output, audio and CMS plugins and LUTs. PackageManager already skipped them. This covers older zips and SMB shares, which create these files too.Checked against the signed dev build:
._files inside UTV.appcodesign --verify --deep --strictunzip--sequesterRsrczip,unzip__MACOSX/sits beside the app)--sequesterRsrczip,ditto -x -kPython bytecode inside the bundle
On first launch Python wrote
__pycache__intoContents/PlugIns/Python,Contents/lib/python3.x/site-packagesand other bundle folders. That breaks the code seal:a sealed resource is missing or invalid. On Windows and Linux, installs in Program Files or/optaren't writable, so modules were recompiled on every launch.PYTHONPYCACHEPREFIXnow points to:~/Library/Caches/UTV/pycacheon macOS~/.cache/UTV/pycacheon Linux,%LOCALAPPDATA%\cache\UTV\pycacheon WindowsA value the user has already set is left alone.